/**
 * 
 */
package com.sahyadri.web.util.service.adpater;

import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;

import com.sahyadri.web.bean.User;

/**
 * Concrete implementation of AuthenticationServiceAdapter
 * 
 * 
 */
public class AuthenticationServiceAdapterImpl implements
		AuthenticationServiceAdapter {

	private static int NUMBER_OF_RANDOM_SECURITY_QUESTIONS = 2;
	private static final Logger log = Logger
			.getLogger(AuthenticationServiceAdapterImpl.class);
	
	@Autowired
	private UserService UserService;
	

	/**
	 * @param webServiceTemplate
	 */
	public AuthenticationServiceAdapterImpl() {
		super();
	}

	@Override
	public boolean authenticate(String loginId, String password) {
		boolean isAuthenticated = false;
		try{
			isAuthenticated = UserService.getUser(loginId, password);
		}catch(Exception e) {
			log.error(e);
			e.printStackTrace();
		}
		

		return isAuthenticated;
	}

	

}
